﻿using BCEntity.OA.TeamWorks.TaskRecord;
using BCEntity.OA.TeamWorks.TaskRejectRecord;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BCData.OA.TeamWorks.TaskRejectRecord
{
    /// <summary>
    /// 工作流任务驳回记录
    /// </summary>
    public interface ITaskRejectRecordData
    {
        /// <summary>
        /// 检查驳回记录是否存在
        /// </summary>
        /// <param name="workflowActivityInstanceId">工作流实例Id</param>
        /// <param name="taskRejectRecordId">任务驳回记录Id</param>
        /// <returns></returns>
        Task<bool> CheckExists(long workflowActivityInstanceId, long taskRejectRecordId);
        /// <summary>
        /// 根据活动实例Id获取任务驳回记录
        /// </summary>
        /// <param name="workflowActivityInstanceId">活动实例Id</param>
        /// <returns></returns>
        Task<IEnumerable<TaskRejectRecordEntity>> GetListByWorkflowActivityInstanceId(long workflowActivityInstanceId);
        /// <summary>
        /// 根据活动实例Id获取任务驳回记录
        /// </summary>
        /// <param name="workflowActivityInstanceId">活动实例Id</param>
        /// <param name="taskRecordNo">任务记录编号</param>
        /// <returns></returns>
        Task<TaskRejectRecordEntity> GetByWorkflowActivityInstanceId(long workflowActivityInstanceId, string taskRecordNo);
        /// <summary>
        /// 根据活动实例Id获取任务驳回记录列表
        /// </summary>
        /// <param name="workflowActivityInstanceId">活动实例Id</param>
        /// <param name="taskRecordNo">任务记录编号</param>
        /// <returns></returns>
        Task<IEnumerable<TaskRejectRecordEntity>> GetListByWorkflowActivityInstanceId(long workflowActivityInstanceId, string taskRecordNo);
        /// <summary>
        /// 根据活动实例Id获取任务驳回记录
        /// </summary>
        /// <param name="workflowActivityInstanceId">活动实例Id</param>
        /// <param name="rejectAdminId">驳回人Id</param>
        /// <param name="rejectReceiverAdminId">驳回接收人Id</param>
        /// <returns></returns>
        Task<IEnumerable<TaskRejectRecordEntity>> GetByWorkflowActivityInstanceId(long workflowActivityInstanceId, long? adminId);

        /// <summary>
        /// 添加任务驳回记录
        /// </summary>
        /// <param name="entity">任务驳回记录</param>
        /// <returns></returns>
        Task<TaskRejectRecordEntity> Add(TaskRejectRecordEntity entity);
        /// <summary>
        /// 分页获取驳回记录
        /// </summary>
        /// <param name="executerAdminId"></param>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <param name="sortName"></param>
        /// <param name="ascending"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        Task<(IEnumerable<TaskRejectRecordViewEntity>, int)> GetListRejectRecordsAsync(long? executerAdminId, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize,int companyId);
    }
}
